package org.gienah.testing.junit;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * Defines the configuration used by the <code>SpringRunner</code> runner to
 * load the Spring configuration files. This annotation must to specify at least
 * the <code>locations</code> or <code>provider</code> attribute. If none of
 * them are present, an error will be reported.
 * 
 * @see org.gienah.testing.junit.SpringRunner
 * @see org.gienah.testing.junit.IContextLoader
 * @author Santiago L. Valdarrama
 * @since E0.1
 */
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
public @interface Configuration {

	/**
	 * Specifies the list of Spring files that will make the Spring context. If
	 * this attribute is used, the <code>provider</code> attribute will be
	 * ignored.
	 */
	String[] locations() default {};

	/**
	 * Specifies the class that will provide the list of Spring files that will
	 * make the Spring context.
	 */
	Class<?> provider() default Configuration.class;

	/**
	 * Specifies the <code>IContextLoader</code> implementation that will be
	 * used to construct the Spring context.
	 */
	Class<? extends IContextLoader> loader() default ContextLoader.class;
}
